;; EX-40.scm - Parallel Structures (JMcC)

;; Mixing sine oscillators in parallel

(let ((n 16))
  (FDiv (Mix.fill n (lambda () (FSinOsc.ar (+ 200 (random 1000))))) 
	(* 2 n)))

(let ((n 16))
  (FDiv (Mix.fill n (lambda () 
		      (let ((f (+ 200 (random 1000)))) 
			(FSinOsc.ar (list f (+ f 0.5))))))
	(* 2 n)))

(let ((n 16)
      (exprand (lambda (a b) (random* random-exponential-normal a b))))
  (FDiv (Mix.fill 
	 n (lambda () 
	     (let ((amp (Max (FSinOsc.ar (exprand 0.1 1) (random two-pi)) 0))) 
	       (Pan2.ar (FSinOsc.ar (exprand 100 1000.0) 0 amp) 
			(random -1 1))))) 
	(* 2 n)))

(let ((n 8))
  (Mix
   (Pan2.ar 
    (CombL.ar 
     (Dust.ar (make-list n 1) 0.3) 0.01 (random-list n 0.0003 0.004) 4) 
    (random-list n -1 1))))

